home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 2 / Atari Mega Archive CD - Volume 2.iso / minix / up1510b.tgz / up1510b / src / fs / filedes.c.D < prev    next >
Text File  |  1990-07-25  |  2KB  |  75 lines

  1. *** /tmp/,RCSt1022217    Wed Jul 25 13:48:42 1990
  2. --- filedes.c    Mon Jul 23 10:35:55 1990
  3. ***************
  4. *** 7,18 ****
  5.    */
  6.   
  7. ! #include "../h/const.h"
  8. ! #include "../h/type.h"
  9. ! #include "../h/error.h"
  10. ! #include "const.h"
  11. ! #include "type.h"
  12.   #include "file.h"
  13.   #include "fproc.h"
  14. - #include "glo.h"
  15.   #include "inode.h"
  16.   
  17. --- 7,13 ----
  18.    */
  19.   
  20. ! #include "fs.h"
  21.   #include "file.h"
  22.   #include "fproc.h"
  23.   #include "inode.h"
  24.   
  25. ***************
  26. *** 20,25 ****
  27.    *                get_fd                         *
  28.    *===========================================================================*/
  29. ! PUBLIC int get_fd(bits, k, fpt)
  30. ! mask_bits bits;            /* mode of the file to be created (RWX bits) */
  31.   int *k;                /* place to return file descriptor */
  32.   struct filp **fpt;        /* place to return filp slot */
  33. --- 15,21 ----
  34.    *                get_fd                         *
  35.    *===========================================================================*/
  36. ! PUBLIC int get_fd(start, bits, k, fpt)
  37. ! int start;            /* start of search (used for F_DUPFD) */
  38. ! mode_t bits;            /* mode of the file to be created (RWX bits) */
  39.   int *k;                /* place to return file descriptor */
  40.   struct filp **fpt;        /* place to return filp slot */
  41. ***************
  42. *** 36,40 ****
  43.   
  44.     /* Search the fproc table for a free file descriptor. */
  45. !   for (i = 0; i < NR_FDS; i++) {
  46.       if (fp->fp_filp[i] == NIL_FILP) {
  47.           /* A file descriptor has been located. */
  48. --- 32,36 ----
  49.   
  50.     /* Search the fproc table for a free file descriptor. */
  51. !   for (i = start; i < OPEN_MAX; i++) {
  52.       if (fp->fp_filp[i] == NIL_FILP) {
  53.           /* A file descriptor has been located. */
  54. ***************
  55. *** 52,55 ****
  56. --- 48,52 ----
  57.           f->filp_mode = bits;
  58.           f->filp_pos = 0L;
  59. +         f->filp_flags = 0;
  60.           *fpt = f;
  61.           return(OK);
  62. ***************
  63. *** 71,75 ****
  64.   
  65.     err_code = EBADF;
  66. !   if (fild < 0 || fild >= NR_FDS ) return(NIL_FILP);
  67.     return(fp->fp_filp[fild]);    /* may also be NIL_FILP */
  68.   }
  69. --- 68,72 ----
  70.   
  71.     err_code = EBADF;
  72. !   if (fild < 0 || fild >= OPEN_MAX ) return(NIL_FILP);
  73.     return(fp->fp_filp[fild]);    /* may also be NIL_FILP */
  74.   }
  75.